
#include <algorithm>
#include <cstdlib>
#include <iomanip>
#include <ios>
#include <iostream>
#include <set>
typedef long long ll;

const ll max_n = 1e5+5;
ll n, q, input,num;
char c;
std::set<ll> pos;

#define NV(v)#v<<" : "<<(v)

int main(){
    freopen("secret.in", "r", stdin);
    freopen("secret.out", "w", stdout);

    std::cin>>n>>q;
    for(ll _{0};_<n;_++){
        std::cin>>input;
        pos.insert(input);
    }
    for(ll _{0};_<q;_++){
        std::cin>>c>>num;

        if(c=='+'){
            pos.insert(num);
        }else if(c=='-'){
            pos.erase(num);
        }else{
            // for(auto i:pos){
            //     std::cout<<i<<' ';
            // }
            // std::cout<<'\n';
            // std::cout<<NV((double)*pos.begin())<<"\n"<<NV((double)*(--pos.end()))<<'\n'<<NV((double)num)<<'\n'<<NV(num)<<'\n';
            const double left {std::abs((double)num-(double)*pos.begin())}, right{std::abs((double)*(pos.rbegin())-(double)num)};
            // auto it = pos.find(num);
            // auto left_it = it,right_it = it;
            // std::cout<<NV(left)<<"  "<<NV(right)<<'\n'<<NV(num)<<'\n';
            std::cout<<std::fixed<<std::setprecision(2)<<(left+right)/2<<'\n';
        }
    }
}